Repository navigation
fix(sentry): drop bare Cloudflare DO isolate reset noise - #962
Conversation
Exact Durable Object memory/CPU isolate-reset messages are transient platform limit hits (for example successive job_run_now on JobManager). Filter them in beforeSend while keeping wrapped recovery failures visible. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
📝 WalkthroughWalkthroughDurable Object isolate memory and CPU reset messages are normalized, recognized, and filtered from Sentry events. Tests cover prefixed and punctuated variants while preserving recovery-exhausted and unrelated reset events. ChangesDurable Object reset filtering
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🔎 Preview deployed: https://kody-pr-962.kody-a99.workers.dev Worker: Mocks:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/worker/src/sentry-options.ts`:
- Around line 114-119: Update isDurableObjectIsolateResetSentryEvent in
packages/worker/src/sentry-options.ts to preserve events when any exception
message is non-reset, rather than allowing an exact bare reset value anywhere to
discard the event; retain filtering for events containing only reset messages.
In packages/worker/src/sentry-options.node.test.ts, model the recovery failure
as separate outer and inner exception values, with the inner value containing
the bare reset cause, and verify the chained event is preserved.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 275579f3-d563-4785-952b-b4cd0a5cd9d8
📒 Files selected for processing (2)
packages/worker/src/sentry-options.node.test.tspackages/worker/src/sentry-options.ts
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Only drop events where every reported message is a bare Cloudflare isolate reset, so outer recovery wrappers with an inner reset cause still reach Sentry. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Summary
Sentry KODY-CLOUDFLARE-2C fired when MCP
job_run_nowhit JobManager during a burst of heavy runs (~45–50s successes, then failure). Cloudflare reset the Durable Object isolate with:Durable Object's isolate exceeded its memory limit and was reset.User job code runs in the LOADER sandbox; this error is the orchestrating JobManager DO exceeding platform memory/CPU limits. The next RPC gets a fresh isolate. App-level retry is unsafe for non-idempotent jobs, and moving heavy orchestration off JobManager is an architectural change outside triage scope.
This PR adds a targeted
beforeSendfilter for the exact Cloudflare isolate memory/CPU reset strings (same class as D1 object-reset blips). Events are dropped only when every reported message is a bare reset, so chained/wrapped recovery failures stay Sentry-visible.mcp-eventlogs are unchanged.Related but separate: #960 stops per-attempt Sentry capture on publish DO-reset retries (RepoSession path).
Test plan
npm run test -- --run packages/worker/src/sentry-options.node.test.tsvalidategreenSystem recap — composes existing primitives (low risk)
Mode: recap · Base:
main@81799504· Head:01dc833fClassification: composes — observability-only
beforeSendfilter for exact Cloudflare DO isolate reset strings; no capability, storage, or auth contract changes.Primitives touched
packages/worker/src/sentry-options.tsbeforeSenddrop for bare DO memory/CPU isolate resetsSystem map
MCP
job_run_now(and similar DO RPC callers) can surface Cloudflare isolate resets when a warm JobManager DO hits platform limits; those exact strings no longer open Sentry issues.Legend: green = composes (wiring only) · amber = extended by this PR · red = new primitive · gray = context (unchanged, included only when an edge crosses it).
Change flow
Summary by CodeRabbit
exceptionand top-levelmessage.